package sprinkler;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Main sprinkler = new Main();
		sprinkler.begin();
	}
/*
 *
Sample input
8 20 2
5 3
4 1
1 2
7 2
10 2
13 3
16 2
19 4
3 10 1
3 5
9 3
6 1
3 10 1
5 3
1 1
9 1
 */
	private void begin() {
		Scanner entrada = new Scanner(System.in);
		PrintStream saida = new PrintStream(System.out);
		int n,l,w;
		ArrayList<Sprinkler> sprinklerList;
		int position;
		int radius;
		double c;		
		while(entrada.hasNext()){
			n = entrada.nextInt();		
			l = entrada.nextInt();
			w = entrada.nextInt();
			sprinklerList = new ArrayList<Sprinkler>(n);
			for(int i=0; i<n; i++){
				position = entrada.nextInt();
				radius = entrada.nextInt();				
				c = radius*radius - ((0.5*w)*(0.5*w));
				sprinklerList.add(new Sprinkler(position,radius,position-c,position+c));
			}
			Collections.sort(sprinklerList);
			System.out.println("list: " + sprinklerList.toString());
/*
 *  Let's analyze.

       r /|
       /  | 0.5*w
|-c--*--c-|-----------
       \  |
         \| 

See the ASCII art above. Sprinkler with origin * and radius r, actually can only fully covers up to length c... 
 which can be calculated via c = r^2-(1/2w)^2.

Thus maximum coverage of a sprinkler is actually [left = position-c, right=position+c].
Sort the sprinklers based on the left value. Then greedily choose sprinklers that covers the longest, this will be the minimum.			
 */
			
			
			
		}	
	}
	
	private class Sprinkler implements Comparable<Sprinkler>{

		
		public Sprinkler(int position, int radius, double left, double right) {
			super();
			this.position = position;
			this.radius = radius;
			this.left = left;
			this.right = right;
		}
		private int position;
		private int radius;
		private double left;
		private double right;		

		@Override
		public int compareTo(Sprinkler other) {
			if(this.left >= other.left) {
				return -1;
			} else {
				return 1;
			}
		}
		
		@Override
		public String toString(){
			return new String("left: " + this.left + "right: " + this.right);
			
		}
		
	}
}
